<%--
  Created by IntelliJ IDEA.
  User: Shinelon
  Date: 2020/11/23
  Time: 14:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<link rel="stylesheet" href="${pageContext.request.contextPath}/style/assets/css/style.css">
<link rel="stylesheet" href="${pageContext.request.contextPath}/style/assets/css/responsive.css">
<script src="${pageContext.request.contextPath}/style/jquery-2.1.0.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" href="${pageContext.request.contextPath}/style/layui/css/layui.css">
<script src="${pageContext.request.contextPath}/style/layui/layui.js"></script>

<html>
<head>
    <title>订单管理</title>
    <script>
        //预备函数
        $(function () {
            //使用layui必须要写的函数
            layui.use(['table','form','layer'], function(){
                var layer = layui.layer;
                var form = layui.form;
                var table = layui.table;
                table1();
                $("#shuaxin").click(function () {
                   table1();
                })
                //表格渲染
                function table1(){
                    table.render({
                    elem: '#test' //id为test的table
                    ,url:'${pageContext.request.contextPath}/selectOrder'   //url 查询数据   所有的客户的数据
                    ,title: '订单表'
                    ,cols: [[
                        {field:'orderid', title:'订单号',fixed: 'left', sort: true,align:'center'}
                        ,{field:'name', title:'预定人姓名',fixed: 'left', width:100,sort: false,align:'center'}
                        ,{field:'tel', title:'预定人手机号',fixed: 'left', width:120,align:'center'}
                        ,{field:'money', title:'单价',fixed: 'left', align:'center',hide:true}
                        ,{field:'yj', title:'押金',fixed: 'left', align:'center',hide:true}
                        ,{field:'price', title:'总价',fixed: 'left', align:'center', width:70,}
                        ,{field:'rzdate', title:'入住日期',align:'center',width:120,templet:function (res) {
                                return layui.util.toDateString(res.rzdate, 'yyyy-MM-dd')
                            }}
                        ,{field:'leavedate', title:'退房日期',width:120,align:'center'}
                        ,{field:'tname', title:'房间类型',width:120,align:'center'}
                        ,{field:'count', title:'数量',align:'center',width:70}
                        ,{field:'istiqian', title:'是否提前',align:'center',hide:true}
                        ,{field:'iszhugou', title:'是否住过',align:'center',hide:true}
                        ,{field:'isquxiao', title:'是否取消',align:'center',hide:true}
                        ,{field:'status', title:'状态', align:'center', width:100,sort: true,templet: function(res){
                                var orderid = res.orderid;
                                var feipei = '';
                                var tuifang ='';
                                    //res  这一行的内容
                                let date = setDate();
                                var ldate = res.leavedate;
                                var f=res.status;//状态值
                                var count = res.count;
                                $.ajax({
                                    url:"/Hotel/qiantai/orderstatus",
                                    data:{orderid:orderid},
                                    dataType:'json',
                                    async:false,
                                    success:function (d) {
                                        feipei = d.feipei;
                                        tuifang = d.tuifang;
                                    },
                                    error:function () {
                                        alert("!!!")
                                    }
                                })
                                $.ajax({
                                    url:'/Hotel/qiantai/iszhugou',
                                    data:{orderid:orderid},
                                    dataType:'json',
                                    async:false,
                                    success:function (d) {
                                        console.log("住过没"+d)
                                    },
                                    error:function ( ) {
                                            alert("cc")
                                    }
                                })
                                $.ajax({
                                    url:"/Hotel/qiantai/tiqiantui",
                                    data:{orderid:orderid},
                                    dataType:'json',
                                    async:false,
                                    success:function (d) {
                                        if(d.length > 0){
                                            var d1 = d[0].outdate;
                                            for( var i =0 ;i < d.length;i++){
                                                if(d1 >= ldate){
                                                    console.log("不算提前退房")
                                                }else{
                                                    $.ajax({
                                                        url:"/Hotel/qiantai/istiqian",
                                                        data:{orderid:orderid},
                                                        dataType:'json',
                                                        async:false,
                                                        success:function (d) {

                                                        },
                                                        error:function () {
                                                            alert("ccc")
                                                        }
                                                    })
                                                }
                                            }
                                        }
                                    },
                                    error:function () {
                                        alert("!!!")
                                    }
                                })
                                console.log(tuifang+"===="+count)
                                if(tuifang == count){
                                    $.ajax({
                                        url:"/Hotel/qiantai/changeorderstatus",
                                        data:{orderid:orderid},
                                        dataType:'json',
                                        async:false,
                                    })
                                }
                                if(f==0 && feipei == 0 && date < ldate){
                                    //正常count
                                    return "已付款";
                                }else if (f == 1 ){
                                    return "已入住";
                                }else if(f == 0 && feipei > 0 && feipei <count){
                                    return "正在入住";
                                }else if(f ==2){
                                    return "已退房";
                                }else if(f == 0 && feipei == 0 && date >= ldate ){
                                    return "未入住";
                                }else if(f == 4 ){
                                    return "已取消";
                                }
                            }
                        }
                        ,{fixed: 'right', title:'操作', toolbar: '#barDemo'}
                    ]]
                    ,page:{
                        curr:1
                        ,limit:20
                        ,limits:[5,10,15,20]
                        ,groups: 100
                        ,layout: ['count', 'prev', 'page', 'next', 'limit',  'skip']
                    }
                    // ,request: {
                    //     pageName: 'page' //页码的参数名称，默认：page
                    //     ,limitName: 'limit' //每页数据量的参数名，默认：limit
                    // }
                });};

                //搜索按钮的点击事件重载表格
                $("#search").click(function () {
                    var orderid = $("#orderid").val();
                    var name = $("#name").val();
                    table.reload('test', {
                        method: 'post'
                        , where: {
                           orderid: orderid,
                            name:name
                        }
                        , page: {
                            curr: 1
                            ,limit:20
                        }
                    })
                })
                //监听行工具栏
                table.on('tool(test)', function(obj){
                    //obj 代表 一行的内容
                    var data = obj.data; //一行的数据
                    console.log(data);
                    //点击取消 退钱
                    if(obj.event === 'weizhuquxiao'){
                        let date = setDate();
                        var leave = data.leavedate;
                        var rz = data.rzdate;
                        var leave1 = new Date(leave).getTime();
                        var rz1 = new Date(rz).getTime();
                        var ndate = new Date(date).getTime();
                        var d ="";
                        var orderid = data.orderid;
                        console.log(d);
                        $("#jiage").html(data.money);
                        $("#leave").html(data.leavedate);
                        var ndatehour = new Date().getHours();
                        var sum ='';
                        var money= data.money;
                        var number = data.count;
                        if(date < rz) {
                            d = (Number(leave1) - Number(rz1)) / (1000 * 60 * 60 * 24);
                            sum = Number(d) * Number(money) * Number(number);
                        }
                        else if( leave > date  && date >= rz) {
                            d = (Number(leave1) - Number(ndate)) / (1000 * 60 * 60 * 24);
                            if(ndatehour > 14){
                                $("#istime").attr("checked",true);
                                sum = (Number(d)-1) * Number(money) * Number(number)+(Number(money)*0*Number(number));
                            }else {
                                $("#istime").attr("checked",false);
                                sum = Number(d) * Number(money) * Number(number);
                            }
                        }else if( leave == date ){
                            d = 0;
                            sum = 0;
                        }
                        $("#syday").html(d);
                        layer.open({
                            title:'取消订单(未入住)',
                            type:1,
                            offset:'0px',
                            content:$("#weizhuquxiaodiv"),
                            area:['600px','550px'],
                            success:function () {
                                form.val('msg', {
                                    "orderid":data.orderid,
                                    "outdate":date,
                                    "sum":data.count,
                                    "tsmoney":sum,
                                    "rzdate":rz
                                });
                            }
                        })
                        var yitui ="";
                        //查看该订单在退房表里的条数
                        $.ajax({
                            url:'/Hotel/qiantai/orderstatus',
                            data:{orderid:orderid},
                            async:false,
                            success:function (d) {
                                yitui = d.tuifang;
                            }
                        })
                        //还有几个房间的数量没退
                        var tuicount = Number(number) - Number(yitui) ;
                        form.on('submit(add)',function (data) {
                            $.ajax({
                                url:"/Hotel/qiantai/addtuifang?tuicount="+tuicount,
                                data:data.field,
                                async:false,
                                success:function(d){
                                    layer.closeAll();
                                    $.ajax({
                                        url:"/Hotel/qiantai/changeorder",
                                        data:{orderid : orderid},
                                        async:false,
                                        success:function (D) {
                                            layer.alert("取消成功！");
                                        },error:function () {
                                            alert("cuo")
                                        }
                                    })
                                    table1();
                                },
                                error:function () {
                                    layer.closeAll();
                                    alert("操作失败");
                                }
                            })
                            return false;
                        })
                    }else if(obj.event ==='zuofei'){
                        let date = setDate();
                        var number = data.count;
                        var yitui ="";
                        //查看该订单在退房表里的条数
                        $.ajax({
                            url:'/Hotel/qiantai/orderstatus',
                            data:{orderid:orderid},
                            async:false,
                            success:function (d) {
                                yitui = d.tuifang;
                            }
                        })
                        //还有几个房间的数量没退
                        var tuicount = Number(number) - Number(yitui) ;
                        $.ajax({
                            url:"/Hotel/qiantai/addtuifang?tuicount="+tuicount,
                            data:{"orderid":data.orderid,"outdate":date,"tsmoney":0,"comm":"过时作废"},
                            async :false,
                            success:function(){
                                layer.closeAll();
                                $.ajax({
                                    url:"/Hotel/qiantai/changeorder",
                                    data:{orderid : data.orderid},
                                    async:false,
                                    success:function (D) {
                                        layer.alert("取消成功！");
                                    },error:function () {
                                        alert("cuo")
                                    }
                                })
                                table1();
                            },
                            error:function () {
                                layer.closeAll();
                                alert("操作失败");
                            }
                        })
                    }else if(obj.event ==='quxiao'){
                        $("#leave1").html(data.leavedate);
                        $("#jiage1").html(data.money);
                        var orderid = data.orderid;
                        var zuiwandate = "";
                        var number = data.count;
                        var yitui ="";
                        //查看该订单在退房表里的条数
                        $.ajax({
                            url:'/Hotel/qiantai/orderstatus',
                            data:{orderid:orderid},
                            async:false,
                            success:function (d) {
                             yitui = d.tuifang;
                            }
                        })
                        //还有几个房间的数量没退
                        var tuicount = Number(number) - Number(yitui) ;
                        //查看最晚的办理退房日期
                        $.ajax({
                            url:'/Hotel/qiantai/selectzuiwan',
                            data:{orderid:orderid},
                            async:false,
                            success:function (d) {
                                zuiwandate = d;
                            }
                        })
                        let date = setDate();
                        var leave = data.leavedate;
                        var rz = data.rzdate;
                        var leave1 = new Date(leave).getTime();
                        var rz1 = new Date(rz).getTime();
                        var ndate = new Date(date).getTime();
                        var ndatehour = new Date().getHours();
                        var zuiwan1 = new Date(zuiwandate).getTime();
                        var money  =data.money;
                        var d ="";
                        var sum ="";
                        console.log("最晚退"+zuiwandate);
                        if(zuiwandate < data.leavedate){
                            d = (Number(leave1) - Number(zuiwan1)) / (1000 * 60 * 60 * 24);
                            if(ndatehour > 14){
                                $("#istime1").attr("checked",true);
                                sum = (Number(d)-1) * Number(money) * Number(number)+(Number(money)*0*Number(number));
                            }else {
                                $("#istime1").attr("checked",false);
                                sum = Number(d) * Number(money) * Number(number);
                            }
                        }else if(zuiwandate == data.leavedate){
                            d = 0;
                            sum = 0;
                        }
                        $("#syday1").html(d);
                        layer.open({
                            title:'取消订单',
                            type:1,
                            offset:'0px',
                            content:$("#yizhuquxiaodiv"),
                            area:['600px','600px'],
                            success:function () {
                                form.val('msg1', {
                                    "orderid":data.orderid,
                                    "outdate":date,
                                    "rzdate":data.rzdate,
                                    "sum":data.count,
                                    "tsmoney":sum,
                                    "zuiwandate":zuiwandate
                                });
                            }
                        })
                        form.on('submit(add1)',function (data) {
                            $.ajax({
                                url:"/Hotel/qiantai/addtuifang?tuicount="+tuicount,
                                data:data.field,
                                async:false,
                                success:function(d){
                                    layer.closeAll();
                                    $.ajax({
                                        url:"/Hotel/qiantai/changeorder",
                                        data:{orderid : orderid},
                                        async:false,
                                        success:function (D) {
                                            layer.alert("取消成功！");
                                        },error:function () {
                                                alert("cuo")
                                        }
                                    })
                                    table1();
                                },
                                error:function () {
                                    layer.closeAll();
                                    alert("操作失败");
                                }
                            })
                            return false;
                        })
                    }
                    else if(obj.event === 'edit'){
                            var id = data.roomtype;
                            var orderid = data.orderid;
                            var rz = data.rzdate;
                            var leave = data.leavedate;
                            var num = data.count;
                            $("#hideCollectionId").html(id);
                            $("#hideCollectionId1").html(orderid);
                            $("#hideCollectionId2").html(rz);
                            $("#hideCollectionId3").html(leave);
                            $("#hideCollectionId4").html(num);
                            layer.open({
                                title:data.tname
                                ,type: 2
                                ,content:'reception.jsp'
                                ,offset: '0px'
                                ,moveOut:true
                                ,resize:false
                                ,closeBtn:false
                                ,btn:['关闭']
                                , btnAlign: 'c'
                                ,area:['1300px','500px']
                                ,move:false
                                ,success:function (dom) {
                                    //拿到剩余的数量
                                    $.ajax({
                                        url:'/Hotel/orderManage/ordercount',
                                        data:{orderid:orderid,num:num},
                                        async:false,
                                        success:function (d) {
                                           var synum = Number(num) - Number(d);
                                            let $iframeDom=$(dom[0]).find("iframe").eq(0).contents();
                                            $iframeDom.find("#count").html(synum);
                                            if( Number($iframeDom.find("#count").html()) == 0){
                                                $iframeDom.find("input[value='入住']").hide();
                                            }
                                        },
                                        error:function (d) {
                                            alert("失败")
                                        }
                                    })
                                },end:function(){
                                    table.reload('test', {
                                        method: 'post'
                                        , where: {
                                            orderid1: orderid,
                                            num1:num
                                        }
                                        , page: {
                                            curr: 1
                                        }
                                    })
                                    $.ajax({
                                        url:'/Hotel/qiantai/iszhugou',
                                        data:{orderid:orderid},
                                        dataType:'json',
                                        async:false,
                                        success:function (d) {
                                            console.log("住过没"+d)
                                        },
                                        error:function ( ) {
                                            alert("cc")
                                        }
                                    })

                                }

                            });
                    }
                    else if(obj.event === 'xiangq'){
                        var orderid = data.orderid;
                        table.render({
                            elem: '#test1'
                            ,height: 312
                            ,url: '/Hotel/qiantai/selectruzhu' //数据接口
                            ,where:{orderid:orderid}
                            ,page: false //开启分页
                            ,cols: [[ //表头
                                {field: 'id', title: 'ID', width:60,sort: true, fixed: 'left',align:'center'}
                                ,{field: 'orderid', title: '订单号',width:150,align:'center'}
                                ,{field: 'ruzhuid', title: '入住单号',width:150,align:'center'}
                                ,{field: 'roomid', title: '房间号',width:90,align:'center'}
                                ,{field: 'name', title: '入住人姓名',width:100,align:'center'}
                                ,{field: 'tel', title: '入住人手机号',width:150,align:'center'}
                                ,{field: 'idcard', title: '入住人身份证',width:180,align:'center'}
                                ,{field: 'rzdate1', title: '入住时间',width:150,align:'center'}
                                ,{field: 'leavedate1', title: '离开时间',width:150,align:'center'}

                            ]]
                        });
                       layer.open({
                           title:'入住详情',
                           type:1,
                           offset:'100px',
                           content:$("#ruzhuxiangqdiv"),
                           area:['1190px','400px'],
                       })
                    }
                });
            })
            function setDate(){
                var now = new Date();
                var year = now.getFullYear(); //年
                var month = now.getMonth() + 1; //月
                // var temp = new Date(year, month, 0); //当前月最后一天
                month = month >= 10 ? month : "0" + month;
                var day = now.getDate(); //日
                day = day >= 10 ? day : "0" + day;
                // var v_from = year + "-" + month + "-01";
                var v_to = year + "-" + month + "-" + day;
                return v_to;
            }
        })
    </script>
</head>
<body>
<%--隐藏域--%>
<div id="hideCollectionId" style="display: none"></div>
<div id="hideCollectionId1" style="display: none"></div>
<div id="hideCollectionId2" style="display: none"></div>
<div id="hideCollectionId3" style="display: none"></div>
<div id="hideCollectionId4" style="display: none"></div>

<div class="layui-form-item" style="margin-top: 10px;">
    <%--增加按钮--%>
    <div class="layui-inline">
        <label class="layui-form-label">订单号</label>
        <div class="layui-input-inline">
            <input type="text" id="orderid" name="orderid" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-inline">
        <label class="layui-form-label" style="width: 100px">订单人姓名</label>
        <div class="layui-input-inline">
            <input type="text" id="name" name="name" autocomplete="off" class="layui-input">
        </div>
    </div>
    <%--检索按钮--%>
    <div class="layui-inline" >
        <button type="button" class="layui-btn layui-btn-warm" id="search">搜索</button>
    </div>
        <div style="float: right;"><input type="button" class="layui-btn layui-btn-sm" value="刷新" id="shuaxin"/></div>
</div>
<%--表格--%>
<table class="layui-hide" id="test" lay-filter="test">
</table>
<%--行工具--%>
<script type="text/html" id="barDemo">
    {{#
        var now = new Date();
        var year = now.getFullYear();
        var month = now.getMonth() + 1;
        var temp = new Date(year, month, 0);
        month = month >= 10 ? month : "0" + month;
        var day = now.getDate();
        day = day >= 10 ? day : "0" + day;
        var v_from = year + "-" + month + "-01";
        var date = year + "-" + month + "-" + day;
    }}
    {{#  if(d.status == 0 && date >= d.rzdate && date < d.leavedate  && d.isquxiao == 0) { }}
    <button id="delbtn" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal" lay-event="edit">分配房间</button>
    {{#  } }}
<%--    {{#  if(d.status == 0 && date < d.rzdate && d.isquxiao == 0 ) { }}--%>
<%--    <button id="delbtn" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal" lay-event="weizhuquxiao">取消订单(未住)</button>--%>
<%--    {{#  } }}--%>
    {{#  if(d.iszhugou == 0 && date >=  d.leavedate && d.isquxiao == 0 ) { }}
    <button id="delbtn" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal" lay-event="zuofei">订单作废</button>
    {{#  } }}
    {{#  if(d.iszhugou == 0 && date <  d.leavedate && d.isquxiao == 0) { }}
    <button id="delbtn" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal" lay-event="weizhuquxiao">取消订单(未住)</button>
    {{#  } }}
    {{#  if(d.iszhugou == 1 && date <=  d.leavedate && d.istiqian ==1 && d.isquxiao == 0 && d.status != 1)  { }}
    <button id="delbtn" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal" lay-event="quxiao">取消订单</button>
    {{#  } }}
    {{#  if(d.status == 4 && d.isquxiao == 1 ) { }}
    <button id="delbtn" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-disabled" lay-event="quxiao1">订单已取消</button>
    {{#  } }}
    {{#  if(d.iszhugou == 1) { }}
    <button id="delbtn" class="layui-btn layui-btn-xs layui-btn-radius layui-btn-normal" lay-event="xiangq">入住详情</button>
    {{#  } }}
    <!-- 这里同样支持 laytpl 语法，如： -->
<%--    {{#  if(d.status == 1 || d.day > 0){ }}--%>
<%--    &lt;%&ndash;        <button type="button" class="layui-btn layui-btn-sm layui-btn-normal" lay-event="edit">&ndash;%&gt;--%>
<%--    &lt;%&ndash;            <i class="layui-icon layui-icon-edit"></i>&ndash;%&gt;--%>
<%--    &lt;%&ndash;        </button>&ndash;%&gt;--%>
<%--    {{#  } }}--%>


</script>
<%--未住退房的弹出表单--%>
<div style="display: none;margin-top: 50px;margin-left: 50px" id="weizhuquxiaodiv">
    <form class="layui-form layui-form-pane" lay-filter="msg" id="weizhuquxiaoform">
        <div style="display: none"><input type="text" name="roomid"/></div>
        <div style="display: none"><input type="text" name="rzdate1"/></div>
        <div style="display: none"><input type="text" name="leavedate1"/></div>
        <div style="display: none"><input type="text" name="roomcode"/></div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单号</label>
            <div class="layui-input-inline">
                <input type="text"  name="orderid" readonly  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="display: none">
            <label class="layui-form-label">ruzhuid</label>
            <div class="layui-input-inline">
                <input type="text"  name="ruzhuid" readonly  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">入住时间</label>
            <div class="layui-input-inline">
                <input type="text"  name="rzdate" lay-verify="required" readonly autocomplete="off" class="layui-input" >
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">退单时间</label>
            <div class="layui-input-inline">
                <input type="text"  name="outdate" lay-verify="required" readonly autocomplete="off" class="layui-input" >
            </div>
            <div class="layui-form-mid layui-word-aux" >订单离店日期：<span id="leave"></span></div>
        </div>

        <div class="layui-form-item">
            <div class="layui-form-mid layui-word-aux">是否超过17：00</div>
            <div class="layui-input-inline" style="width: 80px">
                <input type="checkbox" disabled lay-skin="switch" lay-text="是|否" id="istime">
            </div>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 0px">17：00后天不退</div>
        </div>

        <div class="layui-form-item">

            <label class="layui-form-label" >应退金额</label>
            <div class="layui-input-inline" style="width: 50px;margin-right: 0px">
                <input type="text" name="tsmoney"  autocomplete="off" class="layui-input" readonly>
            </div>
            <label class="layui-form-label" style="width: 50px;">元</label>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 20px"><span id="jiage"></span>/天 还剩<span id="syday"></span>天</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" >房间数量</label>
            <div class="layui-input-inline" style="width: 50px;margin-right: 0px">
                <input type="text" name="sum"  autocomplete="off" class="layui-input" readonly>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline">
                <input type="text" name="comm"   autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-warm" lay-submit lay-filter="add">确定</button>
            </div>
        </div>
    </form>
</div>
<%--已住退房的弹出表单--%>
<div style="display: none;margin-top: 50px;margin-left: 50px" id="yizhuquxiaodiv">
    <form class="layui-form layui-form-pane" lay-filter="msg1" id="yizhuquxiaoform">
        <div style="display: none"><input type="text" name="roomid"/></div>
        <div style="display: none"><input type="text" name="rzdate1"/></div>
        <div style="display: none"><input type="text" name="leavedate1"/></div>
        <div style="display: none"><input type="text" name="roomcode"/></div>
        <div class="layui-form-item">
            <label class="layui-form-label">订单号</label>
            <div class="layui-input-inline">
                <input type="text"  name="orderid" readonly  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" style="display: none">
            <label class="layui-form-label">ruzhuid</label>
            <div class="layui-input-inline">
                <input type="text"  name="ruzhuid" readonly  autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">入住时间</label>
            <div class="layui-input-inline">
                <input type="text"  name="rzdate" lay-verify="required" readonly autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">退房时间</label>
            <div class="layui-input-inline">
                <input type="text"  name="zuiwandate" lay-verify="required" readonly autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">退单时间</label>
            <div class="layui-input-inline">
                <input type="text"  name="outdate" lay-verify="required" readonly autocomplete="off" class="layui-input" >
            </div>
            <div class="layui-form-mid layui-word-aux" >订单离店日期：<span id="leave1"></span></div>
        </div>

        <div class="layui-form-item">
            <div class="layui-form-mid layui-word-aux">是否超过17：00</div>
            <div class="layui-input-inline" style="width: 80px">
                <input type="checkbox" disabled lay-skin="switch" lay-text="是|否" id="istime1">
            </div>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 0px">17：00后天不退</div>
        </div>

        <div class="layui-form-item">

            <label class="layui-form-label" >应退金额</label>
            <div class="layui-input-inline" style="width: 50px;margin-right: 0px">
                <input type="text" name="tsmoney"  autocomplete="off" class="layui-input" readonly>
            </div>
            <label class="layui-form-label" style="width: 50px;">元</label>
            <div class="layui-form-mid layui-word-aux" style="margin-left: 20px"><span id="jiage1"></span>/天 还剩<span id="syday1"></span>天</div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label" >房间数量</label>
            <div class="layui-input-inline" style="width: 50px;margin-right: 0px">
                <input type="text" name="sum"  autocomplete="off" class="layui-input" readonly>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">备注</label>
            <div class="layui-input-inline">
                <input type="text" name="comm"   autocomplete="off" class="layui-input" >
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn layui-btn-warm" lay-submit lay-filter="add1">确定</button>
            </div>
        </div>
    </form>
</div>
<%--入住详情的框--%>
<div style="display: none" id="ruzhuxiangqdiv">
    <table class="layui-hide" id="test1" lay-filter="test1">
    </table>
</div>
</body>
</html>
